import request from '@/utils/request'

// 查询功能应用列表
export function listFunctionApp(query) {
  return request({
    url: '/function-app/functionApp/list',
    method: 'get',
    params: query
  })
}

// 查询功能应用详细
export function getFunctionApp(id) {
  return request({
    url: '/function-app/functionApp/' + id,
    method: 'get'
  })
}

// 新增功能应用
export function addFunctionApp(data) {
  return request({
    url: '/function-app/functionApp',
    method: 'post',
    data: data
  })
}

// 修改功能应用
export function updateFunctionApp(data) {
  return request({
    url: '/function-app/functionApp',
    method: 'put',
    data: data
  })
}

// 删除功能应用
export function delFunctionApp(id) {
  return request({
    url: '/function-app/functionApp/' + id,
    method: 'delete'
  })
}

// 购买功能应用
export function purchaseFunctionApp(data) {
  return request({
    url: '/function-app/functionApp/purchase',
    method: 'post',
    data: data
  })
}

// 获取短信管理统计信息
export function getSmsStatistics() {
  return request({
    url: '/function-app/sms/statistics',
    method: 'get'
  })
}

// 购买短信套餐
export function purchaseSmsPackage(data) {
  return request({
    url: '/function-app/sms/purchase',
    method: 'post',
    data: data
  })
}
